#ifndef PROJECTITEM_H
#define PROJECTITEM_H

#include <defs/export.h>
#include <defs/global.h>
#include <core/entityobject.h>

#include <QtCore>

O_PRIVATE_DECLARE(ProjectItem);
class ProjectItem : public Opl::Core::EntityObject {
    Q_OBJECT
public:
    enum Status {s_unloaded, s_loaded, s_error };
    enum ProjectItemType { pit_project };

    ProjectItem(Opl::Core::EntityObject *parent = 0);
    virtual ~ProjectItem();

    Status status();
    ProjectItem* addItem(ProjectItem* item);

	QList<ProjectItem*> items();

    void setName(const QString& n);
    QString name()const;

    virtual QWidget* widget();
	virtual QVariantMap serialize();
	virtual void deserialize(const QVariantMap& m);
public slots:
	virtual bool create() = 0;
signals:
    void loaded(Status s);
    void changed();

protected:
    void setStatus(Status s);
private:
    O_PRIVATE_DECLARE_MEMBER(ProjectItem);
};

#endif // PROJECTITEM_H

